#include <iostream>
#include <math.h>

using namespace std;

#define MAXCI	8*10E12+3*10E6	

int _round(double x) {
	return (int)(x + 0.999);
}

int main () {
	unsigned long long ci, cil, an;
	int i, il;
	double delta, x1, x2;

	ci = 1;
	i = 0;

	while(cin >> an) {
		delta = 8.0*an - 7.0;
		x2 = (-1.0 + sqrt(delta))/2.0;	
		cout << _round(x2) << endl;
	}

	return 0;
}
